package com.hl.yyx.modules.ums.controller;

import com.hl.yyx.common.log.LogAnnotation;
import com.hl.yyx.common.response.ObjectResponse;
import com.hl.yyx.common.response.Response;
import com.hl.yyx.modules.ums.service.UmsSourceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * <p>
 * 资源表 前端控制器
 * </p>
 *
 * @author hl243695czyn
 * @since 2025-03-26
 */
@RestController
@RequestMapping("/admin/source")
@Api(tags = "资源管理", description = "资源管理")
public class UmsSourceController {
    @Autowired
    private UmsSourceService umsSourceService;


    @LogAnnotation()
    @ApiOperation("文件上传")
    @PostMapping(value = "/upload")
    public Response upload(@RequestParam("file")MultipartFile file, String moduleName) {
        return new ObjectResponse<>(umsSourceService.upload(file, moduleName));
    }
}

